<template>
  <div class="account-payment">
    <el-form-item :label="`本次${labelText}金额`" prop="deductionAmount">
      <el-input v-model="formData.deductionAmount" />
    </el-form-item>
    <el-form-item :label="`${labelText}日期`" prop="paymentDate">
      <el-date-picker style="flex: 1" v-model="formData.paymentDate" type="date" placeholder="请选择" value-format="YYYY-MM-DD" />
    </el-form-item>
  </div>
</template>
<script setup>
import { ref, computed } from "vue";

const props = defineProps(["modelValue", "formLabelVal"]);
const labelText = computed(() => (props.formLabelVal == "payment" ? "付款" : "收款"));
const $emit = defineEmits(["update:modelValue"]);
const formData = computed({
  get() {
    return props.modelValue;
  },
  set(val) {
    $emit("update:modelValue", val);
  }
});
</script>

<style scoped lang="scss">
@import "./index.scss";
</style>
